package com.swjd.servletComponent;

import ch.qos.logback.classic.util.ContextInitializer;
import org.springframework.stereotype.Component;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
//注册方式
//@Component
//注解扫描方式 listener监听器
@WebListener
public class MyListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("contextInitialized执行了》》》》》》》》》");

    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("contextDestroyed执行了》》》》》》》》》》》》》");

    }
}

